<%@ page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>新增用户</title>	
<%@ include file="/common/common.jsp" %>
<script type="text/javascript" src="<%=request.getContextPath() %>/user/js/user.js"></script>
<script type="text/javascript">
function test(){
	$.ajax({
		type:'POST',
		url:"register!validateLoginIdUserful.do",
		cache:false,
		dataType:'json',
		data: {loginId:$("#loginId").val()},
		success:function(data){
			$("#email").val(data);
		},
		error:function(){
			alert("error");
		}
	});
}
function back(){
	document.location.href= "<%=request.getContextPath()%>/${decodeBackUrl}";
}
</script>
</head>
<body>
<div id="formContainer" class="ui-widget-content ui-corner-all">
   	<div class="ui-widget-header ui-corner-top normalHeader">
   		<span class="normalTitle">添加用户</span>
   		<s:if test="%{decodeBackUrl!=null&&decodeBackUrl!=''}">
			<span class="headerSpanBtn" style="border: 0px solid">
				<button id="backBtn">返回</button>
			</span>
		</s:if>
   	</div>
	<s:form id="user" action="user!save.htm?backUrl=%{backUrl}">
		<table class="normalTab">
			<tr>
				<td>
					登录名：
				</td>
				<td>
					<s:textfield id="loginId" name="user.loginId" value="%{user.loginId}"/>
					<font color="red"><s:property value="%{errorMsg}"/></font>
				</td>
			</tr>
			<tr>
				<td>
					登录密码：
				</td>
				<td>
					<s:password id="password" name="user.password"/>
				</td>
			</tr>
			<tr>
				<td>
					密码确认：
				</td>
				<td>
					<s:password id="password2" name="password2"/>
				</td>
			</tr>
			<tr>
				<td>
					昵称：
				</td>
				<td>
					<s:textfield id="nickName" name="user.nickName" value="%{user.nickName}"/>
				</td>
			</tr>
			<tr>
				<td>
					真实名：
				</td>
				<td>
					<s:textfield id="realName" name="user.realName" value="%{user.realName}"/>
				</td>
			</tr>
			<tr>
				<td>
					EMAIL地址：
				</td>
				<td>
					<s:textfield id="email" name="user.email" value="%{user.email}"/>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<s:submit id="submitBtn" cssClass="normalBtn" value="保存" />
					<input type="button" value="test" onclick="test()"/> 
				</td>
			</tr>
		</table>
		<page:context/>
	</s:form>
</div>
</body>
</html>